import { fastCheck } from '../services/checker';

export default {
  namespace: 'checker',

  state: {
    fastResult: '',
  },

  effects: {
    *fastCheck({ payload }, { call, put }){
      const response = yield call(fastCheck, payload);
      yield put({
        type: 'loadFastResult',
        payload: response.data,
      });
    },
  },

  reducers: {
    loadFastResult(state, action){
      return {
        ...state,
        fastResult: action.payload,
      }
    },
  },
};

